﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using DTO;

namespace QLCHHoaLan
{
    public partial class FrmThongTinDatHang : Form
    {
        public BanHangDTO bhDTO;
        public List<ChiTietHoaDonDTO> lstChiTiet;
        public FrmThongTinDatHang()
        {
            InitializeComponent();
        }
        private void LoadThongTinChiTiet()
        {
            txtTenNguoiNhan.Text = bhDTO.NguoiNhan;
            txtSDTNguoiNhan.Text = bhDTO.SDTNguoiNhan.ToString();
            txtDiaChiGiaoHang.Text = bhDTO.DiaChiGiaoHang;
            txtNgayGiao.Text = bhDTO.ThoiGianGiaohang.ToShortDateString();
            txtTenTrangTri.Text = bhDTO.TenTrangTri;
            txtGhiChu.Text = bhDTO.GhiChu;
            txtTongTien.Text = bhDTO.TongTien.ToString();
        }
        private void LoadDanhSachMatHang()
        {
            dgvChiTietDatHang.DataSource = lstChiTiet;
            dgvChiTietDatHang.Columns["MaHoa"].Visible = false;
            dgvChiTietDatHang.Columns["MaCTHD"].Visible = false;
        }
        private void FrmThongTinDatHang_Load(object sender, EventArgs e)
        {
            LoadThongTinChiTiet();
            LoadDanhSachMatHang();            
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Menu main = new Menu();
            main.kq = 1;
            main.Show();
            this.Hide();
        }
    }
}
